package kr.co.hanbit.school;

public  class ManGongupSchool extends School 
{
	protected int gongup;
	
	

	public ManGongupSchool() 
	{
	}

	public ManGongupSchool(int kor,int eng,int mat,int gongup)
	{
		super(kor,eng,mat);
		this.gongup=gongup;
	}
	
	public void dispGongup()
	{
		System.out.println(kor+":"+eng+":"+mat+":"+gongup);
	}
	
	public static void main(String[] args) 
	{
		/*ManGongupSchool mangongup = new ManGongupSchool(100,100,20,10);
		ManSchool manSchool = new ManSchool(1000,10,10,20);
		mangongup.dispGongup();
		manSchool.dispMan();
		System.out.println(mangongup.tot());
		System.out.println(manSchool.tot()); */
		School school = new ManSchool(100,100,100,100);
		System.out.println(school.tot());
		System.out.println(school.avg());


		ManSchool manSchool = (ManSchool)school;
		manSchool.dispMan();
		
		
		school = new ManGongupSchool(200,200,200,200);
		System.out.println(school.tot());
		
		System.out.println(school.avg());
	}

	@Override
	public int tot() 
	{
		return kor+eng+mat+gongup ;
	}

	@Override
	public void dispMan()
	{
		System.out.println(kor+":"+eng+":"+mat+":"+gongup);
	}

	@Override
	public double avg() 
	{
		// TODO Auto-generated method stub
		return tot()/4.0;
	}

}
